package cn.wen.javax.servlet.jsp.tagext.builder.form;

import java.util.Map;

import cn.wen.javax.servlet.jsp.tagext.builder.base.AbstractBuilder;
import cn.wen.javax.servlet.jsp.tagext.form.InputTag;

public abstract class InputBuilder extends AbstractBuilder {

    public InputBuilder(InputTag tag) {
	super(tag);
	this.tag = tag;
    }

    protected InputTag tag = null;

    @Override
    public void process() {
	if (tag.getValue() != null) {
	    context.append("value=\"").append(tag.getValue()).append("\" ");
	}
	Map<String, String> attrs = tag.getAttrs();
	for (String attr : attrs.keySet()) {
	    context.append(attr).append("=\"").append(attrs.get(attr)).append("\" ");
	}
	context.append(">");
    }

}
